//
//  FourVideoView.m
//  YUNWUMeetingDemo
//
//  Created by mac on 2019/7/19.
//  Copyright © 2019 DGL. All rights reserved.
//

#import "FourVideoView.h"

@implementation FourVideoView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUI];
    }
    return self;
}

#pragma mark -- UI
- (void)setUI{
    _fourOneView = [[CustomCameraView alloc]init];
    _fourOneView.backgroundColor = [UIColor yellowColor];
    [self addSubview:_fourOneView];
    [_fourOneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(self);
        make.width.mas_equalTo((Width-1)/2);
        make.height.mas_equalTo((Width-40)/3 + 50);
    }];
    
    _fourTwoView = [[CustomCameraView alloc]init];
    _fourTwoView.backgroundColor = [UIColor greenColor];
    [self addSubview:_fourTwoView];
    [_fourTwoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.mas_equalTo(self);
        make.width.mas_equalTo((Width-1)/2);
        make.height.mas_equalTo(_fourOneView.mas_height);
    }];
    
    _fourThreeView = [[CustomCameraView alloc]init];
    _fourThreeView.backgroundColor = [UIColor grayColor];
    [self addSubview:_fourThreeView];
    [_fourThreeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left);
        make.top.mas_equalTo(_fourOneView.mas_bottom).offset(1);
        make.width.mas_equalTo((Width-1)/2);
        make.height.mas_equalTo(_fourOneView.mas_height);
    }];
    
    _fourFourView = [[CustomCameraView alloc]init];
    _fourFourView.backgroundColor = [UIColor grayColor];
    [self addSubview:_fourFourView];
    [_fourFourView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.mas_right);
        make.top.mas_equalTo(_fourTwoView.mas_bottom).offset(1);
        make.width.mas_equalTo((Width-1)/2);
        make.height.mas_equalTo(_fourOneView.mas_height);
    }];
}

@end
